
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module gummworld2.sprite</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="gummworld2.html"><font color="#ffffff">gummworld2</font></a>.sprite</strong></big></big> (version $Id: sprite.py 248 2011-02-25 15:40:01Z stabbingfinger@gmail.com $)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C:/cygwin/home/bw/devel/python/svn/gummworld2/gamelib/gummworld2/sprite.py">c:\cygwin\home\bw\devel\python\svn\gummworld2\gamelib\gummworld2\sprite.py</a></font></td></tr></table>
    <p><tt>sprite.py&nbsp;-&nbsp;Camera&nbsp;target&nbsp;sprite,&nbsp;free-roaming&nbsp;bucket&nbsp;sprite,&nbsp;and<br>
a&nbsp;bucket&nbsp;sprite&nbsp;group.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="pygame.html">pygame</a><br>
</td><td width="25%" valign=top><a href="gummworld2.toolkit.html">gummworld2.toolkit</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="pygame.sprite.html#Group">pygame.sprite.Group</a>(<a href="pygame.sprite.html#AbstractGroup">pygame.sprite.AbstractGroup</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gummworld2.sprite.html#BucketGroup">BucketGroup</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="pygame.sprite.html#Sprite">pygame.sprite.Sprite</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gummworld2.sprite.html#BucketSprite">BucketSprite</a>
</font></dt><dt><font face="helvetica, arial"><a href="gummworld2.sprite.html#CameraTargetSprite">CameraTargetSprite</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="BucketGroup">class <strong>BucketGroup</strong></a>(<a href="pygame.sprite.html#Group">pygame.sprite.Group</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;sprite&nbsp;group&nbsp;that&nbsp;provides&nbsp;buckets.<br>
&nbsp;<br>
The&nbsp;buckets&nbsp;correlate&nbsp;to&nbsp;the&nbsp;map&nbsp;tile&nbsp;grid.&nbsp;Tile&nbsp;0,0&nbsp;is&nbsp;bucket&nbsp;0,0,&nbsp;tile&nbsp;8,9<br>
is&nbsp;bucket&nbsp;8,9,&nbsp;and&nbsp;so&nbsp;on.<br>
&nbsp;<br>
Instances&nbsp;of&nbsp;this&nbsp;class&nbsp;get,&nbsp;update,&nbsp;and&nbsp;draw&nbsp;sprites&nbsp;in&nbsp;2D&nbsp;ranges&nbsp;of<br>
buckets.&nbsp;The&nbsp;sprites&nbsp;are&nbsp;responsible&nbsp;for&nbsp;hopping&nbsp;from&nbsp;bucket&nbsp;to&nbsp;bucket&nbsp;as<br>
needed,&nbsp;whenever&nbsp;they&nbsp;move.&nbsp;(If&nbsp;you&nbsp;use&nbsp;the&nbsp;<a href="#BucketSprite">BucketSprite</a>&nbsp;this&nbsp;behavior&nbsp;is<br>
built&nbsp;in.)<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gummworld2.sprite.html#BucketGroup">BucketGroup</a></dd>
<dd><a href="pygame.sprite.html#Group">pygame.sprite.Group</a></dd>
<dd><a href="pygame.sprite.html#AbstractGroup">pygame.sprite.AbstractGroup</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="BucketGroup-__init__"><strong>__init__</strong></a>(self, tile_size, map_size, *sprites)</dt><dd><tt>Construct&nbsp;an&nbsp;instance&nbsp;of&nbsp;<a href="#BucketGroup">BucketGroup</a>.</tt></dd></dl>

<dl><dt><a name="BucketGroup-add"><strong>add</strong></a>(self, *sprites)</dt></dl>

<dl><dt><a name="BucketGroup-buckets_in_range"><strong>buckets_in_range</strong></a>(self, dim<font color="#909090">=None</font>)</dt><dd><tt>Return&nbsp;a&nbsp;list&nbsp;of&nbsp;buckets&nbsp;in&nbsp;the&nbsp;range&nbsp;specified&nbsp;by&nbsp;dim.<br>
&nbsp;<br>
The&nbsp;optional&nbsp;dim&nbsp;argument&nbsp;is&nbsp;a&nbsp;tuple(x1,y1,x2,y2)&nbsp;range&nbsp;of&nbsp;grid<br>
coordinates.&nbsp;If&nbsp;dim&nbsp;is&nbsp;None,&nbsp;all&nbsp;buckets&nbsp;are&nbsp;returned.</tt></dd></dl>

<dl><dt><a name="BucketGroup-copy"><strong>copy</strong></a>(self)</dt></dl>

<dl><dt><a name="BucketGroup-draw"><strong>draw</strong></a>(self, dim<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="BucketGroup-empty"><strong>empty</strong></a>(self)</dt></dl>

<dl><dt><a name="BucketGroup-remove_internal"><strong>remove_internal</strong></a>(self, sprite)</dt></dl>

<dl><dt><a name="BucketGroup-sprites_in_range"><strong>sprites_in_range</strong></a>(self, dim<font color="#909090">=None</font>)</dt><dd><tt>Return&nbsp;a&nbsp;list&nbsp;of&nbsp;sprites&nbsp;in&nbsp;the&nbsp;range&nbsp;specified&nbsp;by&nbsp;dim.<br>
&nbsp;<br>
The&nbsp;optional&nbsp;dim&nbsp;argument&nbsp;is&nbsp;a&nbsp;tuple(x1,y1,x2,y2)&nbsp;range&nbsp;of&nbsp;grid<br>
coordinates.&nbsp;If&nbsp;dim&nbsp;is&nbsp;None,&nbsp;all&nbsp;sprites&nbsp;are&nbsp;returned.</tt></dd></dl>

<dl><dt><a name="BucketGroup-update"><strong>update</strong></a>(self, dim<font color="#909090">=None</font>, *args)</dt></dl>

<hr>
Methods inherited from <a href="pygame.sprite.html#AbstractGroup">pygame.sprite.AbstractGroup</a>:<br>
<dl><dt><a name="BucketGroup-__contains__"><strong>__contains__</strong></a>(self, sprite)</dt></dl>

<dl><dt><a name="BucketGroup-__iter__"><strong>__iter__</strong></a>(self)</dt></dl>

<dl><dt><a name="BucketGroup-__len__"><strong>__len__</strong></a>(self)</dt><dd><tt>len(group)<br>
number&nbsp;of&nbsp;sprites&nbsp;in&nbsp;group<br>
&nbsp;<br>
Returns&nbsp;the&nbsp;number&nbsp;of&nbsp;sprites&nbsp;contained&nbsp;in&nbsp;the&nbsp;group.</tt></dd></dl>

<dl><dt><a name="BucketGroup-__nonzero__"><strong>__nonzero__</strong></a>(self)</dt></dl>

<dl><dt><a name="BucketGroup-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>

<dl><dt><a name="BucketGroup-add_internal"><strong>add_internal</strong></a>(self, sprite)</dt></dl>

<dl><dt><a name="BucketGroup-clear"><strong>clear</strong></a>(self, surface, bgd)</dt><dd><tt><a href="#BucketGroup-clear">clear</a>(surface,&nbsp;bgd)<br>
erase&nbsp;the&nbsp;previous&nbsp;position&nbsp;of&nbsp;all&nbsp;sprites<br>
&nbsp;<br>
Clears&nbsp;the&nbsp;area&nbsp;of&nbsp;all&nbsp;drawn&nbsp;sprites.&nbsp;the&nbsp;bgd<br>
argument&nbsp;should&nbsp;be&nbsp;Surface&nbsp;which&nbsp;is&nbsp;the&nbsp;same<br>
dimensions&nbsp;as&nbsp;the&nbsp;surface.&nbsp;The&nbsp;bgd&nbsp;can&nbsp;also&nbsp;be<br>
a&nbsp;function&nbsp;which&nbsp;gets&nbsp;called&nbsp;with&nbsp;the&nbsp;passed<br>
surface&nbsp;and&nbsp;the&nbsp;area&nbsp;to&nbsp;be&nbsp;cleared.</tt></dd></dl>

<dl><dt><a name="BucketGroup-has"><strong>has</strong></a>(self, *sprites)</dt><dd><tt><a href="#BucketGroup-has">has</a>(sprite&nbsp;or&nbsp;group,&nbsp;...)<br>
ask&nbsp;if&nbsp;group&nbsp;has&nbsp;a&nbsp;sprite&nbsp;or&nbsp;sprites<br>
&nbsp;<br>
Returns&nbsp;true&nbsp;if&nbsp;the&nbsp;given&nbsp;sprite&nbsp;or&nbsp;sprites&nbsp;are<br>
contained&nbsp;in&nbsp;the&nbsp;group.&nbsp;You&nbsp;can&nbsp;also&nbsp;use&nbsp;'sprite&nbsp;in&nbsp;group'<br>
or&nbsp;'subgroup&nbsp;in&nbsp;group'.</tt></dd></dl>

<dl><dt><a name="BucketGroup-has_internal"><strong>has_internal</strong></a>(self, sprite)</dt></dl>

<dl><dt><a name="BucketGroup-remove"><strong>remove</strong></a>(self, *sprites)</dt><dd><tt><a href="#BucketGroup-remove">remove</a>(sprite,&nbsp;list,&nbsp;or&nbsp;group,&nbsp;...)<br>
remove&nbsp;sprite&nbsp;from&nbsp;group<br>
&nbsp;<br>
Remove&nbsp;a&nbsp;sprite&nbsp;or&nbsp;sequence&nbsp;of&nbsp;sprites&nbsp;from&nbsp;a&nbsp;group.</tt></dd></dl>

<dl><dt><a name="BucketGroup-sprites"><strong>sprites</strong></a>(self)</dt><dd><tt><a href="#BucketGroup-sprites">sprites</a>()<br>
get&nbsp;a&nbsp;list&nbsp;of&nbsp;sprites&nbsp;in&nbsp;the&nbsp;group<br>
&nbsp;<br>
Returns&nbsp;an&nbsp;object&nbsp;that&nbsp;can&nbsp;be&nbsp;looped&nbsp;over&nbsp;with&nbsp;a&nbsp;'for'&nbsp;loop.<br>
(For&nbsp;now&nbsp;it&nbsp;is&nbsp;always&nbsp;a&nbsp;list,&nbsp;but&nbsp;newer&nbsp;version&nbsp;of&nbsp;Python<br>
could&nbsp;return&nbsp;different&nbsp;iterators.)&nbsp;You&nbsp;can&nbsp;also&nbsp;iterate&nbsp;directly<br>
over&nbsp;the&nbsp;sprite&nbsp;group.</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="pygame.sprite.html#AbstractGroup">pygame.sprite.AbstractGroup</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="BucketSprite">class <strong>BucketSprite</strong></a>(<a href="pygame.sprite.html#Sprite">pygame.sprite.Sprite</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;sample&nbsp;sprite,&nbsp;a&nbsp;la&nbsp;pygame.sprite.<a href="pygame.sprite.html#Sprite">Sprite</a>.<br>
&nbsp;<br>
This&nbsp;class&nbsp;is&nbsp;for&nbsp;sprites&nbsp;that&nbsp;move&nbsp;around&nbsp;the&nbsp;world&nbsp;and&nbsp;are&nbsp;displayed<br>
independently&nbsp;of&nbsp;the&nbsp;camera.<br>
&nbsp;<br>
A&nbsp;position&nbsp;property&nbsp;is&nbsp;required.&nbsp;It&nbsp;is&nbsp;highly&nbsp;recommended&nbsp;the&nbsp;points&nbsp;be&nbsp;a<br>
Vec2d(float,float).&nbsp;Setting&nbsp;position&nbsp;should&nbsp;also&nbsp;set&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>.rect.center,<br>
which&nbsp;should&nbsp;be&nbsp;rounded.<br>
&nbsp;<br>
All&nbsp;sprite&nbsp;positions&nbsp;must&nbsp;be&nbsp;in&nbsp;world&nbsp;coordinates.&nbsp;This&nbsp;means&nbsp;they&nbsp;cannot&nbsp;be<br>
blitted&nbsp;straight&nbsp;to&nbsp;the&nbsp;screen&nbsp;using&nbsp;methods&nbsp;like&nbsp;pygame.sprite.<a href="pygame.sprite.html#Group">Group</a>.<br>
(pygame's&nbsp;<a href="pygame.sprite.html#Group">Group</a>&nbsp;blits&nbsp;using&nbsp;the&nbsp;rect,&nbsp;which&nbsp;is&nbsp;not&nbsp;expressed&nbsp;in&nbsp;screen<br>
coordinates&nbsp;in&nbsp;Gummworld2.)&nbsp;Instead&nbsp;use&nbsp;something&nbsp;like&nbsp;the&nbsp;<a href="#BucketSprite-draw">draw</a>()&nbsp;function<br>
provided&nbsp;here,&nbsp;or&nbsp;better&nbsp;yet&nbsp;a&nbsp;batch&nbsp;draw&nbsp;routine&nbsp;to&nbsp;minimize&nbsp;repetitive<br>
attribute&nbsp;access,&nbsp;such&nbsp;as&nbsp;that&nbsp;in&nbsp;<a href="#BucketGroup">BucketGroup</a>.<br>
&nbsp;<br>
A&nbsp;final&nbsp;consideration&nbsp;for&nbsp;sprites&nbsp;is&nbsp;the&nbsp;sprite&nbsp;group.&nbsp;If&nbsp;the&nbsp;sprite&nbsp;uses&nbsp;a<br>
pygame&nbsp;group,&nbsp;then&nbsp;no&nbsp;special&nbsp;consideration&nbsp;need&nbsp;be&nbsp;given&nbsp;other&nbsp;than&nbsp;to<br>
use&nbsp;a&nbsp;custom&nbsp;<a href="#BucketSprite-draw">draw</a>()&nbsp;method.&nbsp;However,&nbsp;this&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;is&nbsp;designed&nbsp;expressly&nbsp;for<br>
the&nbsp;<a href="#BucketGroup">BucketGroup</a>&nbsp;class.&nbsp;Whenever&nbsp;the&nbsp;sprite&nbsp;moves,&nbsp;it&nbsp;checks&nbsp;what&nbsp;bucket&nbsp;it's<br>
in&nbsp;and&nbsp;hops&nbsp;to&nbsp;another&nbsp;bucket&nbsp;if&nbsp;it&nbsp;should.&nbsp;This&nbsp;is&nbsp;required&nbsp;so&nbsp;the<br>
<a href="#BucketGroup">BucketGroup</a>'s&nbsp;sprites_in_range()&nbsp;and&nbsp;buckets_in_range()&nbsp;methods&nbsp;work<br>
properly&nbsp;and&nbsp;retrieve&nbsp;sprites&nbsp;efficiently.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gummworld2.sprite.html#BucketSprite">BucketSprite</a></dd>
<dd><a href="pygame.sprite.html#Sprite">pygame.sprite.Sprite</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="BucketSprite-__init__"><strong>__init__</strong></a>(self, position<font color="#909090">=(0, 0)</font>)</dt><dd><tt>Construct&nbsp;an&nbsp;instance&nbsp;of&nbsp;<a href="#BucketSprite">BucketSprite</a>.<br>
&nbsp;<br>
One&nbsp;may&nbsp;subclass&nbsp;<a href="#BucketSprite">BucketSprite</a>&nbsp;or&nbsp;simply&nbsp;set&nbsp;its&nbsp;members&nbsp;(image,&nbsp;rect,<br>
etc.)&nbsp;as&nbsp;with&nbsp;pygame&nbsp;sprites.&nbsp;If&nbsp;setting&nbsp;a&nbsp;rect,&nbsp;be&nbsp;sure&nbsp;to&nbsp;update&nbsp;its<br>
position&nbsp;property&nbsp;afterwards:<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;s&nbsp;=&nbsp;<a href="#BucketSprite">BucketSprite</a>()<br>
&nbsp;&nbsp;&nbsp;&nbsp;s.image&nbsp;=&nbsp;...<br>
&nbsp;&nbsp;&nbsp;&nbsp;s.rect&nbsp;=&nbsp;s.image.get_rect()<br>
&nbsp;&nbsp;&nbsp;&nbsp;s.position&nbsp;=&nbsp;s.position&nbsp;&nbsp;##&nbsp;or&nbsp;some&nbsp;other&nbsp;value&nbsp;within&nbsp;map&nbsp;bounds</tt></dd></dl>

<dl><dt><a name="BucketSprite-draw"><strong>draw</strong></a>(s, blit_flags<font color="#909090">=0</font>)</dt><dd><tt>Draw&nbsp;a&nbsp;sprite&nbsp;on&nbsp;the&nbsp;camera's&nbsp;surface&nbsp;using&nbsp;world-to-screen&nbsp;conversion.</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>position</strong></dt>
<dd><tt>Map&nbsp;position&nbsp;in&nbsp;float&nbsp;coordinates.<br>
&nbsp;<br>
For&nbsp;rounded&nbsp;integer&nbsp;(pixel)&nbsp;position&nbsp;read&nbsp;the&nbsp;rect&nbsp;attributes.<br>
&nbsp;<br>
The&nbsp;property&nbsp;setter&nbsp;updates&nbsp;rect.center.&nbsp;If&nbsp;a&nbsp;different&nbsp;rect&nbsp;attribute<br>
is&nbsp;desired,&nbsp;Subclass&nbsp;BucketSprite&nbsp;and&nbsp;override&nbsp;the&nbsp;setter.</tt></dd>
</dl>
<hr>
Methods inherited from <a href="pygame.sprite.html#Sprite">pygame.sprite.Sprite</a>:<br>
<dl><dt><a name="BucketSprite-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>

<dl><dt><a name="BucketSprite-add"><strong>add</strong></a>(self, *groups)</dt><dd><tt>add&nbsp;the&nbsp;sprite&nbsp;to&nbsp;groups<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#BucketSprite-add">add</a>(*groups):&nbsp;return&nbsp;None<br>
&nbsp;<br>
Any&nbsp;number&nbsp;of&nbsp;<a href="pygame.sprite.html#Group">Group</a>&nbsp;instances&nbsp;can&nbsp;be&nbsp;passed&nbsp;as&nbsp;arguments.&nbsp;The&nbsp;<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;will&nbsp;be&nbsp;added&nbsp;to&nbsp;the&nbsp;Groups&nbsp;it&nbsp;is&nbsp;not&nbsp;already&nbsp;a&nbsp;member&nbsp;of.</tt></dd></dl>

<dl><dt><a name="BucketSprite-add_internal"><strong>add_internal</strong></a>(self, group)</dt></dl>

<dl><dt><a name="BucketSprite-alive"><strong>alive</strong></a>(self)</dt><dd><tt>does&nbsp;the&nbsp;sprite&nbsp;belong&nbsp;to&nbsp;any&nbsp;groups<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#BucketSprite-alive">alive</a>():&nbsp;return&nbsp;bool<br>
&nbsp;<br>
Returns&nbsp;True&nbsp;when&nbsp;the&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;belongs&nbsp;to&nbsp;one&nbsp;or&nbsp;more&nbsp;Groups.</tt></dd></dl>

<dl><dt><a name="BucketSprite-groups"><strong>groups</strong></a>(self)</dt><dd><tt>list&nbsp;of&nbsp;Groups&nbsp;that&nbsp;contain&nbsp;this&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a><br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#BucketSprite-groups">groups</a>():&nbsp;return&nbsp;group_list<br>
&nbsp;<br>
Return&nbsp;a&nbsp;list&nbsp;of&nbsp;all&nbsp;the&nbsp;Groups&nbsp;that&nbsp;contain&nbsp;this&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>.</tt></dd></dl>

<dl><dt><a name="BucketSprite-kill"><strong>kill</strong></a>(self)</dt><dd><tt>remove&nbsp;the&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;from&nbsp;all&nbsp;Groups<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#BucketSprite-kill">kill</a>():&nbsp;return&nbsp;None<br>
&nbsp;<br>
The&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;is&nbsp;removed&nbsp;from&nbsp;all&nbsp;the&nbsp;Groups&nbsp;that&nbsp;contain&nbsp;it.&nbsp;This&nbsp;won't<br>
change&nbsp;anything&nbsp;about&nbsp;the&nbsp;state&nbsp;of&nbsp;the&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>.&nbsp;It&nbsp;is&nbsp;possible&nbsp;to&nbsp;continue<br>
to&nbsp;use&nbsp;the&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;after&nbsp;this&nbsp;method&nbsp;has&nbsp;been&nbsp;called,&nbsp;including&nbsp;adding&nbsp;it<br>
to&nbsp;Groups.</tt></dd></dl>

<dl><dt><a name="BucketSprite-remove"><strong>remove</strong></a>(self, *groups)</dt><dd><tt>remove&nbsp;the&nbsp;sprite&nbsp;from&nbsp;groups<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#BucketSprite-remove">remove</a>(*groups):&nbsp;return&nbsp;None<br>
&nbsp;<br>
Any&nbsp;number&nbsp;of&nbsp;<a href="pygame.sprite.html#Group">Group</a>&nbsp;instances&nbsp;can&nbsp;be&nbsp;passed&nbsp;as&nbsp;arguments.&nbsp;The&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;will<br>
be&nbsp;removed&nbsp;from&nbsp;the&nbsp;Groups&nbsp;it&nbsp;is&nbsp;currently&nbsp;a&nbsp;member&nbsp;of.</tt></dd></dl>

<dl><dt><a name="BucketSprite-remove_internal"><strong>remove_internal</strong></a>(self, group)</dt></dl>

<dl><dt><a name="BucketSprite-update"><strong>update</strong></a>(self, *args)</dt><dd><tt>method&nbsp;to&nbsp;control&nbsp;sprite&nbsp;behavior<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#BucketSprite-update">update</a>(*args):<br>
&nbsp;<br>
The&nbsp;default&nbsp;implementation&nbsp;of&nbsp;this&nbsp;method&nbsp;does&nbsp;nothing;&nbsp;it's&nbsp;just&nbsp;a<br>
convenient&nbsp;"hook"&nbsp;that&nbsp;you&nbsp;can&nbsp;override.&nbsp;This&nbsp;method&nbsp;is&nbsp;called&nbsp;by<br>
<a href="pygame.sprite.html#Group">Group</a>.<a href="#BucketSprite-update">update</a>()&nbsp;with&nbsp;whatever&nbsp;arguments&nbsp;you&nbsp;give&nbsp;it.<br>
&nbsp;<br>
There&nbsp;is&nbsp;no&nbsp;need&nbsp;to&nbsp;use&nbsp;this&nbsp;method&nbsp;if&nbsp;not&nbsp;using&nbsp;the&nbsp;convenience&nbsp;<br>
method&nbsp;by&nbsp;the&nbsp;same&nbsp;name&nbsp;in&nbsp;the&nbsp;<a href="pygame.sprite.html#Group">Group</a>&nbsp;class.</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="pygame.sprite.html#Sprite">pygame.sprite.Sprite</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="CameraTargetSprite">class <strong>CameraTargetSprite</strong></a>(<a href="pygame.sprite.html#Sprite">pygame.sprite.Sprite</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;sample&nbsp;camera&nbsp;target&nbsp;sprite,&nbsp;a&nbsp;la&nbsp;pygame.sprite.<a href="pygame.sprite.html#Sprite">Sprite</a>.<br>
&nbsp;<br>
An&nbsp;instance&nbsp;of&nbsp;this&nbsp;class&nbsp;is&nbsp;intended&nbsp;to&nbsp;be&nbsp;the&nbsp;Camera.target&nbsp;for&nbsp;games&nbsp;that<br>
want&nbsp;to&nbsp;use&nbsp;a&nbsp;sprite&nbsp;for&nbsp;the&nbsp;Camera&nbsp;target.&nbsp;It&nbsp;differs&nbsp;from&nbsp;other&nbsp;sprites&nbsp;in<br>
that&nbsp;its&nbsp;screen&nbsp;position&nbsp;is&nbsp;stationary&nbsp;even&nbsp;though&nbsp;it&nbsp;moves&nbsp;around&nbsp;the<br>
game's&nbsp;map.<br>
&nbsp;<br>
A&nbsp;position&nbsp;property&nbsp;is&nbsp;required.&nbsp;It&nbsp;is&nbsp;highly&nbsp;recommended&nbsp;the&nbsp;points&nbsp;be&nbsp;a<br>
Vec2d(float,float).&nbsp;Setting&nbsp;position&nbsp;should&nbsp;also&nbsp;set&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>.rect.center,<br>
which&nbsp;should&nbsp;be&nbsp;rounded.&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>.rect.center&nbsp;can&nbsp;be&nbsp;used&nbsp;in&nbsp;collision&nbsp;tests<br>
versus&nbsp;other&nbsp;sprites&nbsp;or&nbsp;rects&nbsp;expressed&nbsp;in&nbsp;terms&nbsp;of&nbsp;world&nbsp;coordinates.<br>
&nbsp;<br>
This&nbsp;sprite&nbsp;should&nbsp;typically&nbsp;be&nbsp;blitted&nbsp;using&nbsp;the&nbsp;value&nbsp;in&nbsp;screen_position.<br>
It&nbsp;is&nbsp;never&nbsp;changed,&nbsp;so&nbsp;it&nbsp;will&nbsp;always&nbsp;be&nbsp;drawn&nbsp;in&nbsp;the&nbsp;same&nbsp;location&nbsp;on&nbsp;the<br>
screen.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gummworld2.sprite.html#CameraTargetSprite">CameraTargetSprite</a></dd>
<dd><a href="pygame.sprite.html#Sprite">pygame.sprite.Sprite</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="CameraTargetSprite-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>position</strong></dt>
<dd><tt>Map&nbsp;position&nbsp;in&nbsp;float&nbsp;coordinates.<br>
&nbsp;<br>
For&nbsp;rounded&nbsp;integer&nbsp;(pixel)&nbsp;position&nbsp;read&nbsp;the&nbsp;rect&nbsp;attributes.<br>
&nbsp;<br>
The&nbsp;property&nbsp;setter&nbsp;updates&nbsp;rect.center.&nbsp;If&nbsp;a&nbsp;different&nbsp;rect&nbsp;attribute<br>
is&nbsp;desired,&nbsp;subclass&nbsp;CameraTargetSprite&nbsp;and&nbsp;override&nbsp;the&nbsp;setter.</tt></dd>
</dl>
<dl><dt><strong>screen_position</strong></dt>
<dd><tt>Screen&nbsp;position&nbsp;in&nbsp;int&nbsp;coordinates.</tt></dd>
</dl>
<hr>
Methods inherited from <a href="pygame.sprite.html#Sprite">pygame.sprite.Sprite</a>:<br>
<dl><dt><a name="CameraTargetSprite-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>

<dl><dt><a name="CameraTargetSprite-add"><strong>add</strong></a>(self, *groups)</dt><dd><tt>add&nbsp;the&nbsp;sprite&nbsp;to&nbsp;groups<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#CameraTargetSprite-add">add</a>(*groups):&nbsp;return&nbsp;None<br>
&nbsp;<br>
Any&nbsp;number&nbsp;of&nbsp;<a href="pygame.sprite.html#Group">Group</a>&nbsp;instances&nbsp;can&nbsp;be&nbsp;passed&nbsp;as&nbsp;arguments.&nbsp;The&nbsp;<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;will&nbsp;be&nbsp;added&nbsp;to&nbsp;the&nbsp;Groups&nbsp;it&nbsp;is&nbsp;not&nbsp;already&nbsp;a&nbsp;member&nbsp;of.</tt></dd></dl>

<dl><dt><a name="CameraTargetSprite-add_internal"><strong>add_internal</strong></a>(self, group)</dt></dl>

<dl><dt><a name="CameraTargetSprite-alive"><strong>alive</strong></a>(self)</dt><dd><tt>does&nbsp;the&nbsp;sprite&nbsp;belong&nbsp;to&nbsp;any&nbsp;groups<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#CameraTargetSprite-alive">alive</a>():&nbsp;return&nbsp;bool<br>
&nbsp;<br>
Returns&nbsp;True&nbsp;when&nbsp;the&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;belongs&nbsp;to&nbsp;one&nbsp;or&nbsp;more&nbsp;Groups.</tt></dd></dl>

<dl><dt><a name="CameraTargetSprite-groups"><strong>groups</strong></a>(self)</dt><dd><tt>list&nbsp;of&nbsp;Groups&nbsp;that&nbsp;contain&nbsp;this&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a><br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#CameraTargetSprite-groups">groups</a>():&nbsp;return&nbsp;group_list<br>
&nbsp;<br>
Return&nbsp;a&nbsp;list&nbsp;of&nbsp;all&nbsp;the&nbsp;Groups&nbsp;that&nbsp;contain&nbsp;this&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>.</tt></dd></dl>

<dl><dt><a name="CameraTargetSprite-kill"><strong>kill</strong></a>(self)</dt><dd><tt>remove&nbsp;the&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;from&nbsp;all&nbsp;Groups<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#CameraTargetSprite-kill">kill</a>():&nbsp;return&nbsp;None<br>
&nbsp;<br>
The&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;is&nbsp;removed&nbsp;from&nbsp;all&nbsp;the&nbsp;Groups&nbsp;that&nbsp;contain&nbsp;it.&nbsp;This&nbsp;won't<br>
change&nbsp;anything&nbsp;about&nbsp;the&nbsp;state&nbsp;of&nbsp;the&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>.&nbsp;It&nbsp;is&nbsp;possible&nbsp;to&nbsp;continue<br>
to&nbsp;use&nbsp;the&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;after&nbsp;this&nbsp;method&nbsp;has&nbsp;been&nbsp;called,&nbsp;including&nbsp;adding&nbsp;it<br>
to&nbsp;Groups.</tt></dd></dl>

<dl><dt><a name="CameraTargetSprite-remove"><strong>remove</strong></a>(self, *groups)</dt><dd><tt>remove&nbsp;the&nbsp;sprite&nbsp;from&nbsp;groups<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#CameraTargetSprite-remove">remove</a>(*groups):&nbsp;return&nbsp;None<br>
&nbsp;<br>
Any&nbsp;number&nbsp;of&nbsp;<a href="pygame.sprite.html#Group">Group</a>&nbsp;instances&nbsp;can&nbsp;be&nbsp;passed&nbsp;as&nbsp;arguments.&nbsp;The&nbsp;<a href="pygame.sprite.html#Sprite">Sprite</a>&nbsp;will<br>
be&nbsp;removed&nbsp;from&nbsp;the&nbsp;Groups&nbsp;it&nbsp;is&nbsp;currently&nbsp;a&nbsp;member&nbsp;of.</tt></dd></dl>

<dl><dt><a name="CameraTargetSprite-remove_internal"><strong>remove_internal</strong></a>(self, group)</dt></dl>

<dl><dt><a name="CameraTargetSprite-update"><strong>update</strong></a>(self, *args)</dt><dd><tt>method&nbsp;to&nbsp;control&nbsp;sprite&nbsp;behavior<br>
<a href="pygame.sprite.html#Sprite">Sprite</a>.<a href="#CameraTargetSprite-update">update</a>(*args):<br>
&nbsp;<br>
The&nbsp;default&nbsp;implementation&nbsp;of&nbsp;this&nbsp;method&nbsp;does&nbsp;nothing;&nbsp;it's&nbsp;just&nbsp;a<br>
convenient&nbsp;"hook"&nbsp;that&nbsp;you&nbsp;can&nbsp;override.&nbsp;This&nbsp;method&nbsp;is&nbsp;called&nbsp;by<br>
<a href="pygame.sprite.html#Group">Group</a>.<a href="#CameraTargetSprite-update">update</a>()&nbsp;with&nbsp;whatever&nbsp;arguments&nbsp;you&nbsp;give&nbsp;it.<br>
&nbsp;<br>
There&nbsp;is&nbsp;no&nbsp;need&nbsp;to&nbsp;use&nbsp;this&nbsp;method&nbsp;if&nbsp;not&nbsp;using&nbsp;the&nbsp;convenience&nbsp;<br>
method&nbsp;by&nbsp;the&nbsp;same&nbsp;name&nbsp;in&nbsp;the&nbsp;<a href="pygame.sprite.html#Group">Group</a>&nbsp;class.</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="pygame.sprite.html#Sprite">pygame.sprite.Sprite</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>__author__</strong> = 'Gummbum, (c) 2011'<br>
<strong>__version__</strong> = '$Id: sprite.py 248 2011-02-25 15:40:01Z stabbingfinger@gmail.com $'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Gummbum,&nbsp;(c)&nbsp;2011</td></tr></table>
</body></html>